/**
 * 项目相关接口
 */
import { request } from '@/utils/request'

/** 项目列表 */
export function getApprovalList(params) {
  return request.get('/project/basic-information/page', {
    params: {
      pageSize: 10,
      ...params,
    },
  })
}
// 新建项目
export function addProject(params) {
  return request.post('/project/basic-information/create', {
    data: params,
  })
}

// 更新项目
export function updateProject(params) {
  return request.put('/project/basic-information/update', {
    data: params,
  })
}

// 项目列表-基本资料
export function getProjectList(params) {
  return request.get('/projectBasicInfo/page', {
    params: {
      ...params,
    },
  })
}

// 单个项目信息
export function getProjectSingleInfo(params) {
  return request.get('/project/basic-information/get', {
    params: {
      ...params,
    },
  })
}

// 项目仪表盘信息
export function getYiBiaopanInfo(params) {
  return request.get('/project/basic-information/getDashboard', {
    params: {
      ...params,
    },
  })
}

// 删除项目
export function delProject(params) {
  return request.delete(`/project/basic-information/delete?id=${params}`)
}

/** 项目详情 */
export function getDetail(id) {
  return request.get(`/projectBasicInfo/app/${id}`)
}

/** 项目概况中的项目统计 */
export function getNum(id) {
  return request.get(`/projectBasicInfo/getNum/${id}`)
}
// // 项目基本资料
// export function getProjectBasic() {
//   return request.get('/project/basic-information/queryList')
// }

// 获取部门
export function getDeptList() {
  return request.get('/system/dept/list')
}

// 查询用户
export function getUserInfo() {
  return request.get('/system/user/page')
}
// 查询用户
export function getUserFromDept(params) {
  return request.get('/system/user/pageDeptIds', {
    params: {
      ...params,
    },
  })
}
// 项目数量
export function getProjectTotal(params) {
  return request.get('/projectBasicInfo/projectBasicInfoNum', {
    data: params,
  })
}
// 项目需求查询
export function getProjectRequire(params) {
  return request.get('/projectRequirement/pageApp', {
    data: { ...params },
  })
}

// 删除项目需求
export function deleteDemend(params) {
  return request.delete('/projectRequirement', {
    data: [params],
  })
}
// 主线任务
export function getProjectMainTask(params) {
  return request.get('/projectMainTask/pageApp', {
    data: params,
  })
}
// 删除主线任务
export function deleteTask(params) {
  return request.delete('/projectMainTask', {
    data: [params],
  })
}
// 支线任务
export function getTaskList(params) {
  return request.get('/projectSubTask/pageApp', {
    data: params,
  })
}
// 删除支线任务
export function deleteSubTask(params) {
  return request.delete('/projectSubTask', {
    data: [params],
  })
}
// bug管理
export function getTaskBugList(params) {
  return request.get('/projectTaskBug/pageApp', {
    data: params,
  })
}
// 删除bug
export function deleteBugTask(params) {
  return request.delete('/projectTaskBug', {
    data: [params],
  })
}
